hysop.backend.device.opencl.operator.integrate module¶
- class hysop.backend.device.opencl.operator.integrate.OpenClIntegrate(field, variables, name=None, pretty_name=None, cst=1, parameter=None, scaling=None, expr=None, **kwds)[source]¶
Bases:
IntegrateBase
,OpenClOperator
Initialize a Integrate operator base.
Integrate a field on it compute domain and put the result in a parameter.
- in: field
Possibly as multi-component field that should be integrated.
- out: parameter
P = scaling * integral_V(field) where V is the field domain volume and scaling depends on specified scaling method.
parameter¶
- field: Field
Input continuous field to be integrated.
- variables: dict
dictionary of fields as keys and topologies as values.
- parameter: ScalarParameter or TensorParameter
The output parameter that will contain the integral. Should match field.nb_components. A default parameter will be created if not specified.
- scaling: None, float, str or array-like of str, optional
Scaling method used after integration. ‘volumic’: scale by domain size (product of mesh space steps) ‘normalize’: scale by first integration (first value will be 1.0) Can also be a custom float value of tuple of float values. Defaults to volumic integration.
- cst: float, optional
Extra scaling constant for volumic mode.
- kwds:
Extra keywords arguments that will be passed towards implementation enstrophy operator __init__.
- apply(**kwds)¶
Abstract method that should be implemented. Applies this node (operator, computational graph operator…).
- get_field_requirements()[source]¶
Called just after handle_method(), ie self.method has been set. topology requirements are:
min and max ghosts for each input and output variables
allowed splitting directions for cartesian topologies
3) required local and global transposition state, if any. and more
they are stored in self.input_field_requirements and self.output_field_requirements.
keys are continuous fields and values are of type hysop.fields.field_requirement.discretefieldrequirements
default is backend.opencl, no min or max ghosts and no specific transposition state for each input and output variables.
- setup(work)[source]¶
Setup temporary buffer that have been requested in get_work_properties(). This function may be used to execute post allocation routines. This sets self.ready flag to True. Once this flag is set one may call ComputationalGraphNode.apply() and ComputationalGraphNode.finalize().
Automatically honour temporary field memory requests.